<template>
  <div class=''>
    <navBar :title="title"></navBar>
    <ul class="newsList">
      <li>
        <img src="../../../assets/编组 3.png" alt="">
        <div class="news">
          <span>平台消息</span>
          <p>您好，欢迎使用耀美！</p>
        </div>
      </li>
      <li v-for="item in mechanismList" :key="item.id">
        <img :src="item.image">
        <div class="news">
          <span>{{item.name}}</span>
          <p>您好，{{item.name}}，欢迎您</p>
        </div>
      </li>
    </ul>
  </div>
</template> 

<script>
import navBar from '../../../components/navBar'
export default {
  name: '',
  props: {},
  components: {
    navBar,
  },
  data() {
    return {
      title:'消息中心',
      mechanismList : [1,2,3],
    };
  },
  methods: {
    //获取医院
    getHospitalList() {
      this.$api.getHospitalList({
        where: {
          city_id: 6,
        },
        limit: 10,
        page: 2,
      }).then(res=>{
        // console.log(res);
        if(res.code == 200){
          this.mechanismList = res.data
        }
      });
    },
  },
  created(){
    this.getHospitalList()
  }
};
</script>

<style lang='scss' scoped>
  .newsList{
    width: 100%;
    margin-top: 2.9rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    li{
      width: 100%;
      padding: .47rem;
      display: flex;
      img{
        width: 3.67rem;
        height: 3.67rem;
      }
      .news{
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        padding-left: .47rem;
      }
    }
  }
</style>